      SUBROUTINE SETUP
      RETURN
      END
C   HS84
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      INTEGER J
      DOUBLE PRECISION X(NX),A(6),FX,S
      SAVE A
      DATA A/-2.4345D4,-8.720288849D6,1.505125253D5,
     1       -1.566950325D2,4.764703222D5,7.294828271D5/
      ICF=ICF+1
      S=0.D0
      DO      100      J=2,5
      S=S+A(J+1)*X(J)
  100 CONTINUE
      S=(S+A(2))*X(1)
      S=S+A(1)
      FX=-S
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      INTEGER J
      DOUBLE PRECISION X(NX),GRADF(NX),A(6),S
      SAVE A
      DATA A/-2.4345D4,-8.720288849D6,1.505125253D5,
     1       -1.566950325D2,4.764703222D5,7.294828271D5/
      ICGF=ICGF+1
      S=0.D0
      DO      100      J=2,5
      S=S+A(J+1)*X(J)
  100 CONTINUE
      GRADF(1)=-S-A(2)
      DO      200      J=2,5
      GRADF(J)=-A(J+1)*X(1)
  200 CONTINUE
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GRADHI(NX)
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J,K
      DOUBLE PRECISION X(NX),UG(5),OG(5),B(5,3),OB(3),GXI,S
      SAVE UG,OG,B,OB
      DATA UG/0.0D0,1.2D0,20.D0,9.D0,6.5D0/
      DATA OG/1.D3,2.4D0,60.D0,9.3D0,7.D0/
      DATA OB/2*2.94D5,2.772D5/
      DATA B/-1.45421402D5,2.9311506D3,-4.0427932D1,5.106192D3,1.571136
     1    D4,-1.550111084D5,4.36053352D3,1.29492344D1,1.0236884D4,
     2        1.3176786D4,-3.266695104D5,7.39068412D3,-2.78986976D1,
     3        1.6643076D4,3.0988146D4/
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      IF( I .GT. 6)      GOTO 200
      K=(I+1)/2
      S=0.D0
      DO      100      J=2,5
      S=S+B(J,K)*X(J)
  100 CONTINUE
      S=(S+B(1,K))*X(1)
      IF(K+K .EQ. I)     S=OB(K)-S
      GXI=S
      RETURN
  200 CONTINUE
      IF(I .GT. 11)       GXI=OG(I-11)-     X(I-11)
      IF(I .LE. 11)       GXI= X(I- 6)-UG(I-6)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J,K
      DOUBLE PRECISION X(NX),GRADGI(NX),B(5,3),S
      SAVE B
      DATA B/-1.45421402D5,2.9311506D3,-4.0427932D1,5.106192D3,1.571136
     1    D4,-1.550111084D5,4.36053352D3,1.29492344D1,1.0236884D4,
     2        1.3176786D4,-3.266695104D5,7.39068412D3,-2.78986976D1,
     3        1.6643076D4,3.0988146D4/
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
      IF( I .GT.  6)      GOTO 300
      K=(I+1)/2
      S=0.D0
      DO      100      J=2,5
      S=S+B(J,K)*X(J)
      GRADGI(J)= B(J,K)*X(1)
  100 CONTINUE
      GRADGI(1)=S+B(1,K)
      IF(K+K .NE. I)       RETURN
      DO      200      J=1,5
      GRADGI(J)=-GRADGI(J)
  200 CONTINUE
      RETURN
  300 CONTINUE
      DO      400      J=1,5
      GRADGI(J)=0.D0
  400 CONTINUE
      IF(I .GT. 11)       GRADGI(I-11)=-1.D0
      IF(I .LE. 11)       GRADGI(I- 6)= 1.D0
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS84ORIG'/
      DATA (X(I),I=1,5)/2.52D0, 2.D0,3.75D1,9.25D0,6.8D0/
      DATA N/ 5/ , NH/0/ , NG/16/
      DATA DEL0/0.10D0/ ,TAU0/1.D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,16)
     F           /-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,
     F           1,1,1,1,2,1,1,3,1,1,4,1,1,5,1,1,1,-1,1,2,-1,1,3,-1,
     F           1,4,-1,1,5,-1/
      END
